<?php

namespace App\Models;


class SiteMsg extends Base
{

    // 专栏作家
    protected $table = 'site_msg';

    // 缓存字段，用于搜索的字段
    protected $cacheFields = ['id',];

    // {"id":"编号","field":"key值","en_msg":"提示（英文）","cn_msg":"提示（中文）","tc_msg":"提示（台湾）","is_del":"是否删除（1-是）","ctime":"创建时间","mtime":"修改时间"}


    //[ 'id', 'field', 'en_msg', 'cn_msg', 'tc_msg', 'is_del', 'ctime', 'mtime',]


    //array ( 'id' => '$this->getData("id", null, "trim")', 'field' => '$this->getData("field", null, "trim")', 'en_msg' => '$this->getData("en_msg", null, "trim")', 'cn_msg' => '$this->getData("cn_msg", null, "trim")', 'tc_msg' => '$this->getData("tc_msg", null, "trim")', 'is_del' => '$this->getData("is_del", null, "trim")', 'ctime' => '$this->getData("ctime", null, "trim")', 'mtime' => '$this->getData("mtime", null, "trim")', )


    //$id = $this->getData("id", null, 'trim'); $field = $this->getData("field", null, 'trim'); $en_msg = $this->getData("en_msg", null, 'trim'); $cn_msg = $this->getData("cn_msg", null, 'trim'); $tc_msg = $this->getData("tc_msg", null, 'trim'); $is_del = $this->getData("is_del", null, 'trim'); $ctime = $this->getData("ctime", null, 'trim'); $mtime = $this->getData("mtime", null, 'trim');



    // 定义验证操作
    public function rules()
    {

        $add = [
        ];

        $edit = [
        ];

        $info = [
        ];


        $rule = [
            //'id'     => 'required',
            //'en_msg' => 'required',
            //'cn_msg' => 'required',
            //'tc_msg' => 'required',
            'field'  => 'required',
            'is_del' => ['in:0,1,-1'],
            //'ctime'  => 'required',
            //'mtime'  => 'required',
        ];

        $msg = [
            'id'     => '编号',
            'field'  => 'key值',
            'en_msg' => '提示（英文）',
            'cn_msg' => '提示（中文）',
            'tc_msg' => '提示（台湾）',
            'is_del' => '是否删除（1-是）',
            'ctime'  => '创建时间',
            'mtime'  => '修改时间',
        ];

        return ['rule' => $rule, 'msg' => $msg, 'add' => $add];
    }
}
